//
//  DateTools.swift
//  BJ12366Swift
//
//  Created by ZRAR on 16/3/14.
//  Copyright © 2016年 ZRAR. All rights reserved.
//

import Foundation
import UIKit

let kUIScreenHeight = UIScreen.mainScreen().bounds.height

let kUIScreenWidth = UIScreen.mainScreen().bounds.width

extension NSDate{
    
    
    var year:Int{
        
        get{
            return NSCalendar.currentCalendar().component(.Year, fromDate: self)
        }
        
    }
    var month:Int{
        
        get{
            return NSCalendar.currentCalendar().component(.Month, fromDate: self)
        }
    }
    var day:Int{
        get{
            return NSCalendar.currentCalendar().component(.Day, fromDate: self)
        }
    }
    var hour:Int{
        get{
            return NSCalendar.currentCalendar().component(.Hour, fromDate: self)
        }
    }
    var minute:Int{
        get{
            return NSCalendar.currentCalendar().component(.Minute, fromDate: self)
        }
    }
    var second:Int{
        get{
            return NSCalendar.currentCalendar().component(.Second, fromDate: self)
        }
    }
}